package com.imut.onlinebanking.dealings.controller;

import com.imut.onlinebanking.dealings.entity.Account;
import com.imut.onlinebanking.dealings.entity.Records;
import com.imut.onlinebanking.dealings.service.RecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/withdrawals")
public class RecordsController {

    @Autowired
    private RecordsService recordsService;

    @GetMapping()
    public List<Account> getAllWithdrawRecords() {
        return recordsService.getAllWithdrawRecords();
    }

    @GetMapping("/page")
    public String showWithdrawPage() {
        return "withdrawalRecords"; // 返回 HTML 页面名称
    }
}
